package com.qfedu.fmmall.sign.service.impl;

import com.qfedu.fmmall.common.status.ResStatus;
import com.qfedu.fmmall.common.utils.MD5Utils;
import com.qfedu.fmmall.common.vo.ResultVO;
import com.qfedu.fmmall.entity.Users;
import com.qfedu.fmmall.sign.dao.UsersMapper;
import com.qfedu.fmmall.sign.service.UserSignUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * @author : yanBin
 * @date :2022/1/22 15:23
 */
@Service
public class UserSignUpServiceImpl implements UserSignUpService {
    @Autowired
    private UsersMapper usersMapper;

    @Transactional
    public ResultVO insertUsers(Users users) {
        synchronized (this) {
            Integer insert = usersMapper. insertSelective(users);
            if (insert == null) {
                return new ResultVO(ResStatus.NO.getCode(), "注册失败", null);
            }
            return new ResultVO(ResStatus.OK.getCode(), "注册成功", users);
        }
    }

}
